package com.openapi.proto;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 * <pre>
 * 与对外提供的接口名保持一致,  CreateOpenAPI   
 * </pre>
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.47.0)",
    comments = "Source: openapi.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class CreateOpenAPIGrpc {

  private CreateOpenAPIGrpc() {}

  public static final String SERVICE_NAME = "com.openapi.proto.CreateOpenAPI";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.openapi.proto.CreateOpenAPIProto.CreateRequest,
      com.openapi.proto.CreateOpenAPIProto.RpcResponseResult> getCreateMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "create",
      requestType = com.openapi.proto.CreateOpenAPIProto.CreateRequest.class,
      responseType = com.openapi.proto.CreateOpenAPIProto.RpcResponseResult.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.openapi.proto.CreateOpenAPIProto.CreateRequest,
      com.openapi.proto.CreateOpenAPIProto.RpcResponseResult> getCreateMethod() {
    io.grpc.MethodDescriptor<com.openapi.proto.CreateOpenAPIProto.CreateRequest, com.openapi.proto.CreateOpenAPIProto.RpcResponseResult> getCreateMethod;
    if ((getCreateMethod = CreateOpenAPIGrpc.getCreateMethod) == null) {
      synchronized (CreateOpenAPIGrpc.class) {
        if ((getCreateMethod = CreateOpenAPIGrpc.getCreateMethod) == null) {
          CreateOpenAPIGrpc.getCreateMethod = getCreateMethod =
              io.grpc.MethodDescriptor.<com.openapi.proto.CreateOpenAPIProto.CreateRequest, com.openapi.proto.CreateOpenAPIProto.RpcResponseResult>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "create"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.openapi.proto.CreateOpenAPIProto.CreateRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.openapi.proto.CreateOpenAPIProto.RpcResponseResult.getDefaultInstance()))
              .setSchemaDescriptor(new CreateOpenAPIMethodDescriptorSupplier("create"))
              .build();
        }
      }
    }
    return getCreateMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static CreateOpenAPIStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<CreateOpenAPIStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<CreateOpenAPIStub>() {
        @java.lang.Override
        public CreateOpenAPIStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new CreateOpenAPIStub(channel, callOptions);
        }
      };
    return CreateOpenAPIStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static CreateOpenAPIBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<CreateOpenAPIBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<CreateOpenAPIBlockingStub>() {
        @java.lang.Override
        public CreateOpenAPIBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new CreateOpenAPIBlockingStub(channel, callOptions);
        }
      };
    return CreateOpenAPIBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static CreateOpenAPIFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<CreateOpenAPIFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<CreateOpenAPIFutureStub>() {
        @java.lang.Override
        public CreateOpenAPIFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new CreateOpenAPIFutureStub(channel, callOptions);
        }
      };
    return CreateOpenAPIFutureStub.newStub(factory, channel);
  }

  /**
   * <pre>
   * 与对外提供的接口名保持一致,  CreateOpenAPI   
   * </pre>
   */
  public static abstract class CreateOpenAPIImplBase implements io.grpc.BindableService {

    /**
     */
    public void create(com.openapi.proto.CreateOpenAPIProto.CreateRequest request,
        io.grpc.stub.StreamObserver<com.openapi.proto.CreateOpenAPIProto.RpcResponseResult> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getCreateMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                com.openapi.proto.CreateOpenAPIProto.CreateRequest,
                com.openapi.proto.CreateOpenAPIProto.RpcResponseResult>(
                  this, METHODID_CREATE)))
          .build();
    }
  }

  /**
   * <pre>
   * 与对外提供的接口名保持一致,  CreateOpenAPI   
   * </pre>
   */
  public static final class CreateOpenAPIStub extends io.grpc.stub.AbstractAsyncStub<CreateOpenAPIStub> {
    private CreateOpenAPIStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected CreateOpenAPIStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new CreateOpenAPIStub(channel, callOptions);
    }

    /**
     */
    public void create(com.openapi.proto.CreateOpenAPIProto.CreateRequest request,
        io.grpc.stub.StreamObserver<com.openapi.proto.CreateOpenAPIProto.RpcResponseResult> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getCreateMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   * <pre>
   * 与对外提供的接口名保持一致,  CreateOpenAPI   
   * </pre>
   */
  public static final class CreateOpenAPIBlockingStub extends io.grpc.stub.AbstractBlockingStub<CreateOpenAPIBlockingStub> {
    private CreateOpenAPIBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected CreateOpenAPIBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new CreateOpenAPIBlockingStub(channel, callOptions);
    }

    /**
     */
    public com.openapi.proto.CreateOpenAPIProto.RpcResponseResult create(com.openapi.proto.CreateOpenAPIProto.CreateRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getCreateMethod(), getCallOptions(), request);
    }
  }

  /**
   * <pre>
   * 与对外提供的接口名保持一致,  CreateOpenAPI   
   * </pre>
   */
  public static final class CreateOpenAPIFutureStub extends io.grpc.stub.AbstractFutureStub<CreateOpenAPIFutureStub> {
    private CreateOpenAPIFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected CreateOpenAPIFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new CreateOpenAPIFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.openapi.proto.CreateOpenAPIProto.RpcResponseResult> create(
        com.openapi.proto.CreateOpenAPIProto.CreateRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getCreateMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_CREATE = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final CreateOpenAPIImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(CreateOpenAPIImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_CREATE:
          serviceImpl.create((com.openapi.proto.CreateOpenAPIProto.CreateRequest) request,
              (io.grpc.stub.StreamObserver<com.openapi.proto.CreateOpenAPIProto.RpcResponseResult>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class CreateOpenAPIBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    CreateOpenAPIBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.openapi.proto.CreateOpenAPIProto.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("CreateOpenAPI");
    }
  }

  private static final class CreateOpenAPIFileDescriptorSupplier
      extends CreateOpenAPIBaseDescriptorSupplier {
    CreateOpenAPIFileDescriptorSupplier() {}
  }

  private static final class CreateOpenAPIMethodDescriptorSupplier
      extends CreateOpenAPIBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    CreateOpenAPIMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (CreateOpenAPIGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new CreateOpenAPIFileDescriptorSupplier())
              .addMethod(getCreateMethod())
              .build();
        }
      }
    }
    return result;
  }
}
